/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package provider;

import org.jboss.netty.handler.codec.http.HttpClientCodec;
import org.jboss.netty.handler.codec.http.HttpContentDecompressor;
import Converters.NettyConverter;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import static org.jboss.netty.channel.Channels.*;
/**
 *
 * @author MOI
 */
public class ProviderPipelineFactory implements ChannelPipelineFactory {
    private NettyConverter proxy;
    public ProviderPipelineFactory(NettyConverter proxy)
    {
        this.proxy=proxy;
    }
    public ChannelPipeline getPipeline() {
        ChannelPipeline p = pipeline(); // Note the static import.
            p.addLast("codec", new HttpClientCodec());
            p.addLast("inflater", new HttpContentDecompressor());
          p.addLast("handler", new ProviderHandler(proxy));
          return p;
    }

}
